#ifndef DATAPARSER_H
#define DATAPARSER_H

#include <QVariantMap>
#include <QVector>
#include "DataManager.h"

class DataParser
{
public:
    DataParser();
    DataParser(QVariantMap data);

    void setData(QVariantMap data);
    QVariantMap data();

    QVariantMap checkPricelistTemplate(QString filename);
    void get_new_csv(QString column, QString csv_name);
    void serviceMarkSettingsProcessing(int i, bool from_five_to_four = false);
    int uploadPricelist(QString file, int id, QString filename, QVector<QString> user_config);
    QVector<QString> preg_match(QString reg, QString input);
    QVector<QString> relative_reg(QString reg,QString input);
    QString relative_str(QVariantMap result, QString col, QString rel_col);
    bool reg1(QString value, QString pattern);
    QString implode(QString sep, QVector<QString> val);
    int continuePricelistString();

private:
    DataManager m_dManager;

    QVariantMap m_data;
    QVariantMap m_csv;
    QVariantMap m_csv_data;
    QVariantMap m_pricelist_config;
    QVector<int> m_service_mode;
    QVector<QVariantMap> m_service_mark_settings;
    QVariantMap m_pricelist_tmp;

    QVector<QString> m_prev_name;
    QVector<QString> m_prev_field;
    QVector<QString> m_prev_name_replaced;
    QVector<QString> m_prev_field_replaced;

    QVector<bool> m_start_collecting_four;
    QVector<QString> m_line_of_text;

    QVector<QVariantMap> m_pricelist;
};

#endif // DATAPARSER_H
